import crdc, logging, argparse
argp = argparse.ArgumentParser(description='Flat file format validater for the Civil Rights Data Collection')
argp.add_argument('options_file', help='Full file path to the options.ini')
argp.add_argument('input_file', help='Full path to a CRDC flat file')
argp.add_argument('--verbosity', default='info', choices=['warning','info','debug'], help='Display messages with this urgency level or lower')
verbose_levels = dict({'warning': logging.WARNING,
						'info': logging.INFO,
						'debug': logging.DEBUG})
args = argp.parse_args()
crdc = crdc.crdc(args.options_file)
crdc.logger.setLevel(verbose_levels[args.verbosity])
crdc.logger.debug('options-file={}'.format(args.options_file))
crdc.validate_file(args.input_file)
